const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const { VueLoaderPlugin } = require('vue-loader')
const VueSSRServerPlugin = require('vue-server-renderer/server-plugin')

const common = require('./webpack')

module.exports = merge(common, {
  devtool: false,
  target: 'node',
  entry: {
    server: './src/entry/entry-server.ts'
  },

  output: {
    filename: 'script/[name].bundle.js',
    libraryTarget: 'commonjs2',
    chunkFilename: 'script/[name].js',
    path: path.resolve('./dist')
  },

  plugins: [
    new VueSSRServerPlugin()
  ]
})
